home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / Think-Pascal-7.0.cpt / THINK Pascal Interfaces / FileTransfers.p < prev    next >
Encoding:
Text File  |  1991-04-05  |  4.7 KB  |  189 lines  |  [TEXT/PJMM]

  1. {    This file has been processed by The THINK Pascal Source Converter, v1.1.    }
  2.  
  3. {}
  4. {    FileTransfers.p}
  5. {    Pascal Interface to the File Transfer Manager}
  6. {    }
  7. {    Copyright © Apple Computer, Inc. 1988-90}
  8. {    All rights reserved}
  9. {}
  10. {$IFC UNDEFINED UsingIncludes}
  11. {$SETC UsingIncludes := 0}
  12. {$ENDC}
  13.  
  14.  
  15. unit FileTransfers;
  16. interface
  17.     uses
  18.         Types, OSUtils, AppleTalk, Script, Packages, Memory, Dialogs, CTBUtilities;
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.     const
  37. { current file transfer manager version }
  38.         curFTVersion = 2;
  39.  
  40. { FTErr }
  41.         ftGenericError = -1;
  42.         ftNoErr = 0;
  43.         ftRejected = 1;
  44.         ftFailed = 2;
  45.         ftTimeOut = 3;
  46.         ftTooManyRetry = 4;
  47.         ftNotEnoughDSpace = 5;
  48.         ftRemoteCancel = 6;
  49.         ftWrongFormat = 7;
  50.         ftNoTools = 8;
  51.         ftUserCancel = 9;
  52.         ftNotSupported = 10;
  53.  
  54. { FTFlags }
  55.         ftIsFTMode = $00000001;
  56.         ftNoMenus = $00000002;
  57.         ftQuiet = $00000004;
  58.         ftSucc = $00000080;
  59.  
  60. { FTAttributes }
  61.         ftSameCircuit = $0001;
  62.         ftSendDisable = $0002;
  63.         ftReceiveDisable = $0004;
  64.         ftTextOnly = $0008;
  65.         ftNoStdFile = $0010;
  66.  
  67. { FTDirection }
  68.         ftReceiving = 0;
  69.         ftTransmitting = 1;
  70.         ftFullDuplex = 2;
  71.  
  72. { FTChooseRec messages    }
  73.         ftChooseNochange = 1;
  74.         ftChooseBackdoor = 2;
  75.  
  76.     type
  77.         FTErr = OSErr;
  78.         FTFlags = LONGINT;
  79.         FTAttributes = INTEGER;
  80.         FTDirection = INTEGER;
  81.  
  82.     { FTChoose data structures }
  83.         FTChooseRecPtr = ^FTChooseRec;
  84.         FTChooseRec = record
  85.                 reserved: LONGINT;
  86.                 msg: LONGINT;
  87.                 idleProc: ProcPtr;
  88.                 filterProc: ProcPtr;
  89.                 newTool: Str63;
  90.                 newConfig: Ptr;
  91.                 eventProc: ProcPtr;
  92.             end;
  93.  
  94.         FTHandle = ^FTPtr;
  95.         FTPtr = ^FTRecord;
  96.         FTRecord = packed record
  97.                 procID: INTEGER;
  98.  
  99.                 flags: FTFlags;
  100.                 errCode: FTErr;
  101.  
  102.                 refCon: LONGINT;
  103.                 userData: LONGINT;
  104.  
  105.                 defProc: ProcPtr;
  106.  
  107.                 config: Ptr;
  108.                 oldConfig: Ptr;
  109.  
  110.                 environsProc: ProcPtr;
  111.                 reserved1: LONGINT;
  112.                 reserved2: LONGINT;
  113.  
  114.                 ftPrivate: Ptr;
  115.  
  116.                 sendProc: ProcPtr;
  117.                 recvProc: ProcPtr;
  118.                 writeProc: ProcPtr;
  119.                 readProc: ProcPtr;
  120.  
  121.                 owner: WindowPtr;
  122.  
  123.                 direction: FTDirection;
  124.                 theReply: SFReply;
  125.  
  126.                 writePtr: LONGINT;
  127.                 readPtr: LONGINT;
  128.                 theBuf: ^char;
  129.                 bufSize: LONGINT;
  130.                 autoRec: Str255;
  131.                 attributes: FTAttributes;
  132.             end;
  133.  
  134.     function InitFT: FTErr;
  135.     function FTGetVersion (hFT: FTHandle): Handle;
  136.     function FTGetFTVersion: INTEGER;
  137.  
  138.     function FTNew (procID: INTEGER; flags: FTFlags; sendProc: ProcPtr; recvProc: ProcPtr; readProc: ProcPtr; writeProc: ProcPtr; environsProc: ProcPtr; owner: WindowPtr; refCon: LONGINT; userData: LONGINT): FTHandle;
  139.  
  140.     procedure FTDispose (hFT: FTHandle);
  141.  
  142.     function FTStart (hFT: FTHandle; direction: FTDirection; fileInfo: SFReply): FTErr;
  143.     function FTAbort (hFT: FTHandle): FTErr;
  144.  
  145.     procedure FTExec (hFT: FTHandle);
  146.  
  147.     procedure FTActivate (hFT: FTHandle; activate: BOOLEAN);
  148.     procedure FTResume (hFT: FTHandle; resume: BOOLEAN);
  149.     function FTMenu (hFT: FTHandle; menuID: INTEGER; item: INTEGER): BOOLEAN;
  150.  
  151.     function FTChoose (var hFT: FTHandle; where: Point; idleProc: ProcPtr): INTEGER;
  152.     function FTPChoose (var hFT: FTHandle; where: Point; var cRec: FTChooseRec): INTEGER;
  153.     procedure FTEvent (hFT: FTHandle; theEvent: EventRecord);
  154.  
  155.     function FTValidate (hFT: FTHandle): BOOLEAN;
  156.     procedure FTDefault (var theConfig: Ptr; procID: INTEGER; allocate: BOOLEAN);
  157.  
  158.     function FTSetupPreflight (procID: INTEGER; var magicCookie: LONGINT): Handle;
  159.     procedure FTSetupSetup (procID: INTEGER; theConfig: Ptr; count: INTEGER; theDialog: DialogPtr; var magicCookie: LONGINT);
  160.     function FTSetupFilter (procID: INTEGER; theConfig: Ptr; count: INTEGER; theDialog: DialogPtr; var theEvent: EventRecord; var theItem: INTEGER; var magicCookie: LONGINT): BOOLEAN;
  161.     procedure FTSetupItem (procID: INTEGER; theConfig: Ptr; count: INTEGER; theDialog: DialogPtr; var theItem: INTEGER; var magicCookie: LONGINT);
  162.     procedure FTSetupCleanup (procID: INTEGER; theConfig: Ptr; count: INTEGER; theDialog: DialogPtr; var magicCookie: LONGINT);
  163.     procedure FTSetupXCleanup (procID: INTEGER; theConfig: Ptr; count: INTEGER; theDialog: DialogPtr; OKed: BOOLEAN; var magicCookie: LONGINT);
  164.  
  165.     procedure FTSetupPostflight (procID: INTEGER);
  166.  
  167.     function FTGetConfig (hFT: FTHandle): Ptr;
  168.     function FTSetConfig (hFT: FTHandle; thePtr: Ptr): INTEGER;
  169.  
  170.     function FTIntlToEnglish (hFT: FTHandle; inputPtr: Ptr; var outputPtr: Ptr; language: INTEGER): OSErr;
  171.     function FTEnglishToIntl (hFT: FTHandle; inputPtr: Ptr; var outputPtr: Ptr; language: INTEGER): OSErr;
  172.  
  173.     procedure FTGetToolName (procID: INTEGER; var name: Str255);
  174.     function FTGetProcID (name: Str255): INTEGER;
  175.  
  176.     procedure FTSetRefCon (hFT: FTHandle; refCon: LONGINT);
  177.     function FTGetRefCon (hFT: FTHandle): LONGINT;
  178.  
  179.     procedure FTSetUserData (hFT: FTHandle; userData: LONGINT);
  180.     function FTGetUserData (hFT: FTHandle): LONGINT;
  181.  
  182.     procedure FTGetErrorString (hFT: FTHandle; id: INTEGER; var errMsg: Str255);
  183.  {UsingFileTransfers}
  184.  
  185.  
  186. implementation
  187. end.
  188.  
  189.